package com.gitee.wsl.collections.map.bikey


interface BiKey<R, C> {
    /**
     * Returns the key row corresponding to this key.
     *
     * @return the key row corresponding to this key
     */
    val row: R

    /**
     * Returns the key column corresponding to this key.
     *
     * @return the key column corresponding to this key
     */
    val column: C

    /**
     * Compares the specified object with this entry for equality. Returns
     * <tt>true</tt> if the given object is also a bikey and the two entries
     * represent the same key.
     *
     * @param o
     * object to be compared for equality with this map entry
     * @return <tt>true</tt> if the specified object is equal to this bikey
     */
    //override fun equals(o: Any): Boolean

    /**
     * Returns the hash code value for this bikey.
     *
     * @return the hash code value for this bikey
     * @see Object.hashCode
     * @see Object.equals
     * @see .equals
     */
    //override fun hashCode(): Int
    companion object
}

operator fun<R, C> BiKey.Companion.invoke(row:R, col:C):BiKey<R, C> = BiKeyImp(row, col)


internal data class BiKeyImp<R, C>(
    override val row: R,
    override val column: C
):BiKey<R, C>